package com.atguigu.userprofile.dao

import com.atguigu.userprofile.bean.{TagInfo, TaskInfo}
import com.atguigu.userprofile.util.MySqlUtil

object TaskInfoDAO {

  def getTaskInfoById(taskId:String): TaskInfo ={
    var taskInfo:TaskInfo=null;
    val sql = s"select  * from  task_info where   id=$taskId"
    val taskInfoOpt: Option[TaskInfo] = MySqlUtil.queryOne(sql,classOf[TaskInfo],true)
    if(taskInfoOpt==None){
      throw  new RuntimeException(s"no task for task_id:$taskId" )
    }else{
      taskInfo=taskInfoOpt.get
    }
    taskInfo

  }

}
